feat(agents): let read-only CR agents use git worktrees for parallel review#728
Conversation
…review argos and athena may now opt into an isolated read-only git worktree to run their parallel CR pass when isolation is needed; daidalos cleans every CR worktree up after the run/merge so the repository stays clean. The writing path (talos) still never uses worktrees and concurrent writers still serialise on the single shared working tree via the write-lock — only the read-only CR pass gains the explicit-request opt-in of @rules/git/general.mdc Worktrees / Workspaces, which carries no write-lock and never contends with the writing path. Documented in agents/daidalos.md, agents/argos.md, agents/athena.md Parallel review worktree, mirrored in docs/agents.md, with the worktree pinning test in tests/Installer/AgentsTest.php updated to the new policy.
Technical reportCode review (self-check): clean. The change is confined to agent prose ( Security review: no-op. No code path, input handling, external request, or secret surface is added or modified; the worktree creation is Verification: |
…pt-in Two restatements still said worktrees were forbidden workflow-wide, which contradicted the new read-only CR worktree opt-in in the same file. Scope both to the writing path, consistent with docs/agents.md. Self-CR (PR #728): resolves 2 Moderate consistency findings.
CR status — convergedLoop: converged on iteration 1 — 0 Critical / 0 Moderate / 0 Minor. Resolved items
Verification: |
Summary
Refines the agent worktree policy so the read-only code-review agents (
argos,athena) may opt into an isolated git worktree to run their parallel CR pass when isolation is genuinely needed, and makesdaidalosclean every CR worktree up after the run / merge so the repository and codebase stay clean.This is a deliberate, scoped relaxation of the earlier "git worktrees are forbidden across the whole workflow" rule — not a blanket reversal:
talos(and every writingdaidalosrun) still never uses a worktree and still serialises on the single shared working tree via the write-lock. There is no isolated-worktree escape for the writing path.argos/athenaare read-only, an isolated checkout lets the two parallel CR passes review a stable diff without contending with the writing path or each other. This is exactly the explicit-request opt-in of@rules/git/general.mdcWorktrees / Workspaces, granted to the CR pass only.daidalosremoves them in step 7 (git worktree remove+git worktree prune, never--force, skipping the active/dirty tree), and after a merge confirms@skills/merge-github-pr/SKILL.mdleft no orphaned branch / worktree / temp file behind. A CR agent run standalone removes its own worktree.Changes
agents/daidalos.md— Concurrency & the working-tree write-lock section retitled and rewritten (writing path stays on the shared tree, read-only CR may isolate); step 6 instructs the CR dispatch prompts to grant the worktree opt-in; step 7 gains explicit worktree + post-merge cleanup.agents/argos.md,agents/athena.md— new Parallel review worktree (optional) section + aWorktree:handoff field.docs/agents.md— concurrency narrative updated to match (writing path never uses worktrees; CR pass may isolate; daidalos cleans up).tests/Installer/AgentsTest.php— worktree pinning test rewritten to the new policy, plus a new test asserting both CR agents document the opt-in worktree and hand it back for cleanup.CHANGELOG.md— Unreleased entry.Testing
composer build— green (install + fix + full check: skill-check, normalize, phpcs, pint, rector, phpstan, security-audit,test:coverage). 324 tests / 1856 assertions pass, 100% coverage.vendor/bin/pest tests/Installer/AgentsTest.php— 29 passed.Notes